// fabu/xueyuan/xueyuanCom/select/select.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
   key:{
     type:String,
     value:'年级'
   },
   gradeArray:{
     type:Array,
    value:[{
      id:'one',
      value:'一年级'
    }, 
    {
        id: 'two',
        value: '一年级'
    },
    {
        id: 'three',
        value: '一年级'
    }]
   },
   morenP:{
     type:String
    //  value:'六年级'
   },
   absty:{
     type:String
    },
    xingStyle: {
      type: String
    },
    xing: {
      type: String,
      value: '*'
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
   select:false,
   moren:'六年级'
  },
  ready:function()
  {
    this.setData({
      moren:this.properties.morenP
    })
  },
  /**
   * 组件的方法列表
   */
  methods: {
      showSelect:function(event)
      {
        //console.log(event)
        this.setData({
          select:!this.data.select
        })
      },
      mySelect:function(event)
      {
        // console.log(event)
    var id=event.currentTarget.id
        var name = event.currentTarget.dataset.name
        //console.log(name)
        this.setData({
          select: !this.data.select,
          moren:name
        })
        this.triggerEvent('select',{name,id})
       }
  }
})
